import java.util.*;
public class slojenie {
	static int length=5;
	static int len=length;
	public static void sloj(){
		int [] arr1 = new int [length];
		int [] arr2 = new int [length];
		int [] arr3= new int [length + 1];
		
			for(int i=length-1; i>=0; i--){
				arr1[i] = (int) (Math.random()*10); 
				arr2[i] = (int) (Math.random()*10);
				if(arr3[length]!=0){
				arr3[length]= arr1[length-1]+arr2[length-1] + 1;
				if(arr3[length] >= 10){
					arr3[length]=arr3[length] % 10;
					arr3[length-1]=arr3[length-1] + 1;
				}
			}
				else{
					arr3[length]= arr1[length-1]+arr2[length-1];
					if(arr3[length] >= 10){
						arr3[length]=arr3[length] % 10;
						arr3[length-1]=arr3[length-1] + 1;
						}
				}
				length--;
		}
		for(int i= 0; i<len; i++){
			System.out.print( arr1[i]);}
			System.out.println();
		for(int i= 0; i<len; i++){
			System.out.print( arr2[i]);}
			System.out.println();
		for(int i= 0; i<len+1; i++){
			System.out.print(arr3[i]);}
			System.out.println();
		}
	
	public static void main(String[] args) {
//		reader rd = new reader();
//		rd.scan();
//		System.out.println();
//		char [] R = rd.w.toCharArray();
//		for(int i=0; i<R.length; i++){
//			R[i]-='0';
//		}
//		String RD = new String (R, 0, R.length);
//		//System.out.println(RD);
//		char [] T = rd.y.toCharArray();
//		for(int i=0; i<T.length; i++){
//			T[i]-='0';
//		}
//		String RD1 = new String (T, 0, T.length);
//		//System.out.println(RD1);
		sloj();
		}}


